<?php
/**
 *
 */
namespace Yz\modules\Tasklist;

class Item_List_Task
    extends \Yz_Item_List
{


    public function topLevel()
    {
        debug();
        $action = $this->model->selectAction('SelectTopLevel');
        $values = $action->perform();
        return $this->assignList($values);
    }

    public function tree()
    {
        $list = $this->all();
        $tree = new \Yz_Tree_Default;
        foreach ($list as $item) {
            $p = $item->parent;
            $tree->createElement($item->id, $item, ($p ? $p->id : null) );
        }
        return $tree;
    }

}
